library(ggplot2) # beautiful graphs

library(ggthemes) # nice themes for ggplot2

library(ggbeeswarm) # helpful 'beeswarm' geometry

library(cowplot) # arrrange graphs

library(pander) # nice tables

How to Choose a Chart

Choosing the right chart to represent your data can be a daunting process. I believe that a starting point for this thinking is some basic statistical thinking about the type of variables that you have. At the broadest level, variables may be conceptualized as categorical variables, or continuous variables.

Once we have discerned the type of variable that have, there are two followup questions we may ask before deciding upon a chart strategy:

A Few Notes

A Note About Graph Labels

Graphs should have clear titles and labels.

A Simulated Data File of Continuous and Categorical Data

A few randomly selected observations…

  x y z u v w s q
567 113.2 54.62 116.3 Group A Group A Group A Group 2 133.2
85 60.57 112.5 87.72 Group A Group A Group A Group 3 90.57
843 199.7 215.3 99.28 Group B Group B Group B Group 1 209.7
656 198.5 241.8 103.8 Group A Group A Group B Group 3 228.5
815 108.3 128.3 143.9 Group B Group B Group A Group 3 138.3
882 201.2 219.7 93.29 Group B Group B Group B Group 2 221.2
113 152.3 72.8 86.55 Group B Group B Group A Group 3 182.3
826 96.91 54.67 86.61 Group B Group B Group A Group 2 116.9
498 128.5 97.52 87.1 Group A Group A Group A Group 4 168.5
193 82.12 144.6 72.16 Group B Group B Group A Group 3 112.1

One Thing At A Time           Two Things At A Time

Continuous           Continuous By Categorical

One Thing At A Time           Two Things At A Time

Categorical           Categorical By Categorical

Continuous by Continuous

Graphics made with the ggplot2 graphing library created by Hadley Wickham.

Available online at https://agrogan1.github.io/

How to Choose a Chart by Andrew Grogan-Kaylor is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. You are welcome to download and use this handout in your own classes, or work, as long as the handout remains properly attributed.

Last updated: August 29 2019 at 10:10